﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ERP.ERPSystem.ProductionSystem.Dto;
using ERP.Team.ProductionSystem;
using Volo.Abp.Application.Services;

namespace ERP.ERPSystem.ProductionSystem
{
    /// <summary>
    /// 生产派单
    /// </summary>
    public interface IProductionDispatchMainServices : IApplicationService
    {
        /// <summary>
        /// 添加生产派单
        /// </summary>
        /// <param name="productionDispatchMainDto"></param>
        /// <returns></returns>
        Task<int> AddProductionDispatch(ProductionDispatchMainDto productionDispatchMainDto);

        /// <summary>
        /// 显示生产派单
        /// </summary>
        /// <returns></returns>
        Task<List<ProductionDispatchMain>> GetProductionDispatch();

        /// <summary>
        /// 获取指定前缀的工单数量
        /// </summary>
        /// <param name="prefix">前缀</param>
        /// <returns></returns>
        Task<int> GetWorkOrderCountByPrefix(string prefix);

        /// <summary>
        /// 更新派单人员
        /// </summary>
        /// <param name="id">派单ID</param>
        /// <param name="newOrderTarget">新的派单人员</param>
        /// <returns></returns>
        Task<int> UpdateOrderTarget(int id, string newOrderTarget);

        /// <summary>
        /// 批量更新派单人员
        /// </summary>
        /// <param name="ids">派单ID列表</param>
        /// <param name="newOrderTarget">新的派单人员</param>
        /// <returns></returns>
        Task<int> BatchUpdateOrderTarget(List<int> ids, string newOrderTarget);

        /// <summary>
        /// 根据ID获取生产派单信息
        /// </summary>
        /// <param name="id">派单ID</param>
        /// <returns></returns>
        Task<ProductionDispatchMain> GetProductionDispatchById(int id);

        /// <summary>
        /// 更新生产派单信息
        /// </summary>
        /// <param name="id">派单ID</param>
        /// <param name="productionDispatchMainDto">更新的派单信息</param>
        /// <returns></returns>
        Task<int> UpdateProductionDispatch(int id, ProductionDispatchMainDto productionDispatchMainDto);

        /// <summary>
        /// 删除生产派单
        /// </summary>
        /// <param name="id">派单ID</param>
        /// <returns></returns>
        Task<int> DeleteProductionDispatch(int id);

        /// <summary>
        /// 批量删除生产派单
        /// </summary>
        /// <param name="ids">派单ID列表</param>
        /// <returns></returns>
        Task<int> BatchDeleteProductionDispatch(List<int> ids);
    }
}
